﻿//
// eCRAM, a monthly activity report web application
// Copyright (C) 2010  Aptea
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

using System;
using System.Data.Linq.Mapping;

namespace eCRAM.Model
{
    /// <summary>
    /// Declares a user activity: mission, holidays, sickness, week ends, project...
    /// </summary>
    [Table(Name="Activities")]
    public class Activity
    {
        [Column(IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]
        public Guid Id { get; set; }

        /// <summary>
        /// Beginning of the activity.
        /// </summary>
        [Column]
        public DateTime StartDate { get; set; }

        /// <summary>
        /// End of the activity.
        /// </summary>
        [Column]
        public DateTime EndDate { get; set; }

        /// <summary>
        /// Type of activity (mission, holidays, sickness, week ends, project...).
        /// </summary>
        [Column]
        public ActivityType Type { get; set; }

        /// <summary>
        /// Name of the activity.
        /// </summary>
        [Column]
        public string Name { get; set; }

        /// <summary>
        /// Activity is active.
        /// </summary>
        [Column]
        public bool IsActive { get; set; }


        //public void CreateActivity()
        //{
        //    ActivityRepository activityRepo = new ActivityRepository();
        //    activityRepo.Create(this);
        //    activityRepo.SubmitChanges();
        //}
        
        //public void DeleteActivity()
        //{
        //    ActivityRepository activityRepo = new ActivityRepository();
        //    activityRepo.Delete(this);
        //    activityRepo.SubmitChanges();
        //}

    }
}
